package com.cdut.cn.boke.pojo;


/**
 自定义异常类型，,在业务逻辑相关的地方抛出这个异常
 */
public class ServiceException extends RuntimeException {

    private Integer code = 500;
    private String msg = "自定义服务器异常";

    public ServiceException(ExceptionCodeMsgEnum exceptionCodeMsgEnum) {
        super(); //调用父类的构造函数
        this.code = exceptionCodeMsgEnum.getCode();
        this.msg = exceptionCodeMsgEnum.getMessage();
    }

    public ServiceException(Integer code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
